<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<html>
	<head>
		<title>任务节点历史数据管理</title>
		<%@ include file="/common/meta.jsp"%>
		<%@ include file="/common/jquery-ui-inc.jsp"%>
		<script>

$(function() {
	$('#lockList').datagrid( {
		title : '流程任务日志列表',
		url : '${ctx}/flow/core/flow-query!taskMsg.action',
		loadMsg : '数据载入中，请稍后……',
		nowrap : false,
		//striped: true,
		collapsible : false,
		fitColumns : true,
		pagination : true,
		singleSelect : true,
		rownumbers : true,
		remoteSort : false,
		pageList : [ 15, 30, 50 ],
		idField : 'id',
		columns : [ [ {
			field : 'executionId',
			title : '实例 Id',
			width : 120
		},{
			field : 'id',
			title : '任务Id',
			width : 80,
			sorter : function(a, b) {
				return (a > b ? 1 : -1);
			}
		}, {
			title : '执行者',
			field : 'assignee',
			width : 240
		}, {
			title : '状态',
			field : 'state',
			width : 100,
			formatter: function(val, rec,rowIndex){
				if(val == 'completed')return "<span style='color:green;'>结束</span>";
			}
		}, {
			title : '开始时间',
			field : 'createTime',
			width : 200
		}, {
			title : '结束时间',
			field : 'endTime',
			width : 200
		}, {
			title : '持续时间(秒)',
			field : 'duration',
			width : 200,
			formatter:function(value){
				return value/1000;
			}
		}] ]
	});
	
	         //初始化日期组件
			 $('#startAfterDatestr').datetimebox({});
			 $(".datetimebox :text").attr("readonly","readonly"); 
			  $('#startBeforeDatestr').datetimebox({});
			 $(".datetimebox :text").attr("readonly","readonly"); 
	
	
});
	function reload(){
		$('#lockList').datagrid("reload");
	}
	
	function searchList(){					
	 	var queryParams = $('#lockList').datagrid('options').queryParams;	    
	       	var opt = $('#lockList').datagrid('options'); 
	       	 $('#lockList').datagrid('options').pageNumber=1;
	        queryParams["processInstanceId"] = $('#processInstanceId').val();
	        $('#lockList').datagrid('reload');
	         var page = $('#lockList').datagrid('getPager');
			page.pagination({pageNumber:1,pageSize:opt.pageSize});
	  }
	  
	function clearSearch(){					
       $('#processInstanceId').val('');
		searchList(); 
	  }  
	  
			
	</script>
	</head>

	<body>
	<div title="查询" id="list"  class="easyui-panel" icon="icon-search"  collapsible="true">
	 <form action="" id="searform" name="searform" method="post">
        <table class="info"  cellpadding="0" cellspacing="1" id="searProIns">
                <tr>                   
             	<td class="datagrid-header">&nbsp;&nbsp;流程实例id：</td>
                 <td> <input type=text id="processInstanceId" name="processInstanceId" value="" size=20 /> </td>  <td>&nbsp;<a class="easyui-linkbutton" iconCls="icon-search" onClick="searchList()">查 询</a>&nbsp;<a class="easyui-linkbutton" iconCls="icon-cut" onClick="clearSearch();">清空</a></td>                 
                 </tr>  
            </table>
        </form>
        </div>
	
		<table id="lockList"></table>
	</body>
</html>